package com.polytech.diploma.StatAccumulator.Comparator;

public class StatComparator{
	
	double CALCULATION_INTERVAL = 0.05;
	
	int compareWithConfidenceRange(double param1, double param2, double frequency1, double frequency2)
	{
		/**
		 * Equals in range of confidence
		 */
		if(param1 < param2 + param2 * CALCULATION_INTERVAL
			&& param1 > param2 - param2 * CALCULATION_INTERVAL)
		{
			if(frequency1 > frequency2)
				return 1;
			else if(frequency1 < frequency2)
				return -1;
			else
				return 0;				
		}
		else if(param1 > param2)
				return 1;
			else if(param1 < param2)
				return -1;
			else
				return 0;
	}
}
